package com.doit.day03.不可变集合

object _10_元祖 {
  def main(args: Array[String]): Unit = {
    //其实他就是一个类 Tuple 这个类很特殊，他可以任意的放元素进去
    val tuple: (Int, String, Double, Boolean) = new Tuple4[Int, String, Double, Boolean](10, "zss", 10.9, true)

    //简单的
    val tuple1: (Int, Int, Double, String, Char, Boolean) = (1, 2, 3.2, "hello", 'c', true)

    // id  name  age   gender
    val tuple2: (Int, String, Int, String) = (1, "zss", 18, "male")

    println(tuple2._1)

    val tuple3: (Int, String, Int, String) = (2, "lss", 28, "female")

    val tuple4: (Int, (Int, String), Double, String) = (1, (1, "zss"), 1.9, "zss")
    println(tuple4._3)
    println(tuple4._2._2)

    //几元元祖   2元元祖   对偶元祖  (key,value)


  }
}
